﻿using Abp.NHibernate.EntityMappings;
using Abp.Notifications;
using Akso.Authorization.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.NHibernate.EntityMappings
{
    /// <summary>
    /// Define mapping between <see cref="NotificationSubscription"/> entity and "AbpNotificationSubscriptions" table using FluentNHibernate.
    /// 
    /// Inherits from <see cref="EntityMap{TEntity,TPrimaryKey}"/>.
    /// EntityMap gets table name in it's constructor and automatically maps Id property. So, we do not map Id again.
    /// </summary>
    public class NotificationSubscriptionMap : EntityMap<NotificationSubscriptionInfo, Guid>
    {
        public NotificationSubscriptionMap() : base("AbpNotificationSubscriptions")
        {
            LazyLoad();
            Id(x => x.Id);
            Map(x => x.CreationTime);
            Map(x => x.CreatorUserId);
            Map(x => x.EntityId);
            Map(x => x.EntityTypeAssemblyQualifiedName);
            Map(x => x.EntityTypeName);
            Map(x => x.NotificationName);
            Map(x => x.TenantId);
            Map(x => x.UserId);
            //References(x => x.AssignedPerson).Column("AssignedPersonId").LazyLoad();
        }
    }
}
